<?=$this->form?>
<h3>Requisitos</h3>

<form method="get" action="<?=$this->url(array('controller'=>'requisitos','action'=>'add', 'tarefa'=> $this->form->getValue('id')));?>">
    <select name="tipo">
        <option>Tarefa</option>
        <option>Monetario</option>
        <option>Item</option>
    </select>
    <input type="submit" value="Criar novo Requisito" />
</form>

<?if(!$this->tarefa->getRequisitos()->isEmpty()):?>
<ul>
<?foreach($this->tarefa->getRequisitos() as $requisito):?>
    <li>
        Requisito: <?=$this->partial('_partials/'.end(explode('\\', get_class($requisito))).'.phtml', array('requisito'=>$requisito));?> |
        <a class="confirm" href="<?=$this->url(array('controller'=>'requisitos', 'action'=>'delete', 'id'=> $requisito->getId(), 'tarefa'=> $this->form->getValue('id')));?>">Excluir</a>
    </li>
<?endforeach;?>
</ul>
<?endif;?>
<h3>Benefícios</h3>
<form method="get" action="<?=$this->url(array('controller'=>'beneficios','action'=>'add', 'tarefa'=> $this->form->getValue('id')));?>">
    <select name="tipo">
        <option>Item</option>
        <option>Monetario</option>
    </select>
    <input type="submit" value="Criar novo Beneficio" />
</form>

<?if(!$this->tarefa->getBeneficios()->isEmpty()):?>
<ul>
<?foreach($this->tarefa->getBeneficios() as $beneficio):?>
    <li>
        Benefício: <?=$this->partial('_partials/'.end(explode('\\', get_class($beneficio))).'.phtml', array('beneficio'=>$beneficio));?> |
        <a class="confirm" href="<?=$this->url(array('controller'=>'beneficios', 'action'=>'delete', 'id'=> $beneficio->getId(), 'tarefa'=> $this->form->getValue('id')));?>">Excluir</a>
    </li>
<?endforeach;?>
</ul>
<?endif;?>
<a href="<?=$this->url(array('controller'=>'tarefas','action'=>'index'));?>">Listar</a> | 
<a class="confirm" href="<?=$this->url(array('controller'=>'tarefas','action'=>'delete','id'=> $this->form->getValue('id')));?>">Excluir</a>